home *** CD-ROM | disk | FTP | other *** search
/ IRIX Installation Tools & Overlays 2002 November / SGI IRIX Installation Tools & Overlays 2002 November - Disc 4.iso / dist / motif21_dev.idb / usr / Motif-2.1 / include / Xm / DragC.h.z / DragC.h
C/C++ Source or Header  |  2002-10-15  |  6KB  |  232 lines

  1. /* 
  2.  *  @OSF_COPYRIGHT@
  3.  *  COPYRIGHT NOTICE
  4.  *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
  5.  *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
  6.  *  the full copyright text.
  7. */ 
  8. /* 
  9.  * HISTORY
  10. */ 
  11. /*   $TOG: DragC.h /main/13 1998/02/03 14:56:15 csn $ */
  12. /*
  13. *  (c) Copyright 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  14. /* $TOG: DragC.h /main/13 1998/02/03 14:56:15 csn $ */
  15.  
  16. #ifndef _XmDragController_h
  17. #define _XmDragController_h
  18.  
  19. #include <Xm/Xm.h>
  20. #include <Xm/Display.h>
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26.  
  27. /* defines for the dragFinish completionStatus field */
  28.  
  29. #define XmHELP            2
  30.  
  31. /*
  32.  * Some global stuff that will go into Xm.h
  33.  */
  34. typedef unsigned int    XmID;
  35.  
  36. /***********************************************************************
  37.  *
  38.  * DragContext
  39.  *
  40.  ***********************************************************************/
  41.  
  42. #ifndef XmIsDragContext
  43. #define XmIsDragContext(w) XtIsSubclass(w,xmDragContextClass)
  44. #endif /* XmIsDragContext */
  45.  
  46. #ifndef _XA_MOTIF_DROP
  47. #define _XA_MOTIF_DROP "_MOTIF_DROP"
  48. #define _XA_DRAG_FAILURE "_MOTIF_DRAG_FAILURE"
  49. #define _XA_DRAG_SUCCESS "_MOTIF_DRAG_SUCCESS"
  50. #endif /* _XA_MOTIF_DROP */
  51.  
  52. /* enums used for the message_type in client messages */
  53.  
  54. enum{    XmTOP_LEVEL_ENTER,        XmTOP_LEVEL_LEAVE,
  55.     XmDRAG_MOTION,            XmDROP_SITE_ENTER,
  56.     XmDROP_SITE_LEAVE,        XmDROP_START,
  57.     XmDROP_FINISH,            XmDRAG_DROP_FINISH,
  58.     XmOPERATION_CHANGED
  59.     } ;
  60.  
  61. /* enums for completionStatus */
  62. enum{    XmDROP,                XmDROP_HELP,
  63.     XmDROP_CANCEL,            XmDROP_INTERRUPT
  64.     } ;
  65.  
  66. /* values for operation */
  67. #define    XmDROP_NOOP    0L
  68. #define XmDROP_MOVE     (1L << 0)
  69. #define XmDROP_COPY    (1L << 1)
  70. #define XmDROP_LINK    (1L << 2)
  71.  
  72. /* 2.1.20 change */
  73. enum{    XmMOVE = XmDROP_MOVE,        XmCOPY = XmDROP_COPY,
  74.     XmLINK = XmDROP_LINK,        XmOTHER
  75.     };
  76.  
  77. enum{    XmBLEND_ALL,            XmBLEND_STATE_SOURCE,
  78.     XmBLEND_JUST_SOURCE,        XmBLEND_NONE
  79.     } ;
  80.  
  81. enum{      XmDROP_FAILURE,            XmDROP_SUCCESS
  82.     } ;
  83.  
  84.  
  85. /* enums used for the public callback reason */
  86.  
  87. enum{    XmCR_TOP_LEVEL_ENTER,        XmCR_TOP_LEVEL_LEAVE,
  88.     XmCR_DRAG_MOTION,        XmCR_DROP_SITE_ENTER,
  89.     XmCR_DROP_SITE_LEAVE,        XmCR_DROP_START,
  90.     XmCR_DROP_FINISH,        XmCR_DRAG_DROP_FINISH,
  91.     XmCR_OPERATION_CHANGED,
  92.  
  93.     _XmNUMBER_DND_CB_REASONS
  94.     } ;
  95.  
  96.  
  97. /* Class record constants */
  98. typedef struct _XmDragContextClassRec    *XmDragContextClass;
  99. typedef struct _XmDragContextRec    *XmDragContext;
  100. externalref WidgetClass xmDragContextClass;
  101.  
  102. typedef struct _XmAnyICCCallbackStruct{
  103.     int              reason;
  104.     XEvent              *event;
  105.     Time                timeStamp;
  106. }XmAnyICCCallbackStruct, *XmAnyICCCallback;
  107.  
  108. typedef struct _XmTopLevelEnterCallbackStruct{
  109.     int              reason;
  110.     XEvent              *event;
  111.     Time                timeStamp;
  112.     Screen        *screen;
  113.     /*
  114.      * the window field is different if this is an outbound or inbound
  115.      * callback. Outbound == reciever, Inbound == initiator.
  116.      */
  117.     Window        window;
  118.     Position        x, y;
  119.     unsigned char    dragProtocolStyle;
  120.     Atom        iccHandle;
  121. }XmTopLevelEnterCallbackStruct, *XmTopLevelEnterCallback;
  122.  
  123. typedef struct _XmTopLevelLeaveCallbackStruct{
  124.     int              reason;
  125.     XEvent              *event;
  126.     Time                timeStamp;
  127.     Screen        *screen;
  128.     Window        window;
  129. }XmTopLevelLeaveCallbackStruct, *XmTopLevelLeaveCallback;
  130.  
  131. /* 
  132.  * this message is sent from the receiver to the initiator to
  133.  * indicate that the motion message with the associated timestamp has
  134.  * caused a drop-site to be entered
  135.  */
  136. typedef struct _XmDropSiteEnterCallbackStruct{
  137.     int              reason;
  138.     XEvent              *event;
  139.     Time                timeStamp;
  140.     unsigned char    operation;
  141.     unsigned char    operations;
  142.     unsigned char    dropSiteStatus;
  143.     Position        x, y;
  144. }XmDropSiteEnterCallbackStruct, *XmDropSiteEnterCallback;
  145.  
  146. /* 
  147.  * this message is sent from the receiver to the initiator to
  148.  * indicate that the motion message with the associated timestamp has
  149.  * caused a drop-site to be left
  150.  */
  151. typedef struct _XmDropSiteLeaveCallbackStruct{
  152.     int              reason;
  153.     XEvent              *event;
  154.     Time                timeStamp;
  155. }XmDropSiteLeaveCallbackStruct, *XmDropSiteLeaveCallback;
  156.  
  157. typedef struct _XmDragMotionCallbackStruct{
  158.     int              reason;
  159.     XEvent              *event;
  160.     Time                timeStamp;
  161.     unsigned char    operation;
  162.     unsigned char    operations;
  163.     unsigned char    dropSiteStatus;
  164.     Position        x, y;
  165. }XmDragMotionCallbackStruct, *XmDragMotionCallback;
  166.  
  167. typedef struct _XmOperationChangedCallbackStruct{
  168.     int              reason;
  169.     XEvent              *event;
  170.     Time                timeStamp;
  171.     unsigned char    operation;
  172.     unsigned char    operations;
  173.     unsigned char    dropSiteStatus;
  174. }XmOperationChangedCallbackStruct, *XmOperationChangedCallback;
  175.  
  176. typedef struct _XmDropStartCallbackStruct{
  177.     int              reason;
  178.     XEvent              *event;
  179.     Time                timeStamp;
  180.     unsigned char    operation;
  181.     unsigned char    operations;
  182.     unsigned char    dropSiteStatus;
  183.     unsigned char    dropAction;
  184.     Position        x, y;
  185.     Window        window;
  186.     Atom        iccHandle;
  187. }XmDropStartCallbackStruct, *XmDropStartCallback;
  188.  
  189. typedef struct _XmDropFinishCallbackStruct{
  190.     int              reason;
  191.     XEvent              *event;
  192.     Time                timeStamp;
  193.     unsigned char    operation;
  194.     unsigned char    operations;
  195.     unsigned char    dropSiteStatus;
  196.     unsigned char    dropAction;
  197.     unsigned char    completionStatus;
  198. }XmDropFinishCallbackStruct, *XmDropFinishCallback;
  199.  
  200. typedef struct _XmDragDropFinishCallbackStruct{
  201.     int              reason;
  202.     XEvent              *event;
  203.     Time                timeStamp;
  204. }XmDragDropFinishCallbackStruct, *XmDragDropFinishCallback;
  205.  
  206.  
  207. /********    Public Function Declarations    ********/
  208.  
  209. extern Widget XmDragStart( 
  210.                         Widget w,
  211.                         XEvent *event,
  212.                         ArgList args,
  213.                         Cardinal numArgs) ;
  214. extern void XmDragCancel( 
  215.                         Widget dragContext) ;
  216. extern Boolean XmTargetsAreCompatible( 
  217.                         Display *dpy,
  218.                         Atom *exportTargets,
  219.                         Cardinal numExportTargets,
  220.                         Atom *importTargets,
  221.                         Cardinal numImportTargets) ;
  222.  
  223. /********    End Public Function Declarations    ********/
  224.  
  225.  
  226. #ifdef __cplusplus
  227. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  228. #endif
  229.  
  230. #endif /* _DragController_h */
  231. /* DON'T ADD STUFF AFTER THIS #endif */
  232.